﻿@namespace BlazorComponent
@inherits BDomComponentBase

<CascadingValue Value="this" IsFixed>
    <div class="@CssProvider.GetClass()" style="@CssProvider.GetStyle()" id="@Id" @ref="Ref" @attributes="@Attributes">
        <BListItem @onclick="@HandleOnClick" @attributes="GetAttributes(typeof(BListItem))">
            @if (PrependIcon is not null || PrependIconContent != default)
            {
                <BListItemIcon @attributes="GetAttributes(typeof(BListItemIcon),PREPEND)">
                    @if (PrependIconContent != default)
                    {
                        @PrependIconContent
                    }
                    else
                    {
                        <BIcon @attributes="GetAttributes(typeof(BIcon))">
                            @PrependIcon
                        </BIcon>
                    }
                </BListItemIcon>
            }

            @ActivatorContent

            @if (AppendIcon is not null || AppendIconContent != default)
            {
                <BListItemIcon @attributes="GetAttributes(typeof(BListItemIcon),APPEND)">
                    @if (AppendIconContent != default)
                    {
                        @AppendIconContent
                    }
                    else
                    {
                        <BIcon @attributes="GetAttributes(typeof(BIcon))">
                            @AppendIcon
                        </BIcon>
                    }
                </BListItemIcon>
            }
        </BListItem>

        @if (IsBooted)
        {
            <ExpandTransition>
                <ShowTransitionElement Value="IsActive"
                                       class="@CssProvider.GetClass("items")"
                                       Style="@CssProvider.GetStyle("items")">
                    @ChildContent
                </ShowTransitionElement>
            </ExpandTransition>
        }
    </div>
</CascadingValue>
